import request from '@/utils/request'

export function saveCategory(data) {
  return request({
    url: '/mms/v1/course/category/save',
    method: 'post',
    data
  })
}

export function listCategory(query) {
  return request({
    url: '/mms/v1/course/category/list',
    method: 'get',
    params: query
  })
}

export function saveCourse(data) {
  return request({
    url: '/mms/v1/course/save',
    method: 'post',
    data
  })
}
export function getCourseList(query) {
  return request({
    url: '/mms/v1/course/list',
    method: 'get',
    params: query
  })
}
// 删除课程
export function delCourse(data) {
  return request({
    url: '/mms/v1/course/delete',
    method: 'post',
    data
  })
}

// 获取预约列表
export function getAppointment(params) {
  return request({
    url: '/mms/v1/appointment/list',
    method: 'get',
    params
  })
}

// 获取课程详情
export function getCourseDetail(query) {
  return request({
    url: `/mms/v1/course/detail/${query.courseId}`,
    method: 'get'
  })
}

// 确认联系人
export function sureCourseContact(data) {
  return request({
    url: `/mms/v1/appointment/contact`,
    method: 'post',
    data
  })
}
